home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch18 / 18fig27.wrl < prev    next >
Text File  |  1996-09-23  |  1KB  |  70 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Rotating fan
  8.         Shape {
  9.             appearance Appearance {
  10.                 material Material { }
  11.                 texture ImageTexture {
  12.                     url "fan.png"
  13.                     repeatS FALSE
  14.                     repeatT FALSE
  15.                 }
  16.                 textureTransform DEF FanRotation TextureTransform {
  17.                     center 0.5 0.5
  18.                 }
  19.             }
  20.             geometry DEF Square IndexedFaceSet {
  21.                 coord Coordinate {
  22.                     point [
  23.                         -1.0 -1.0 -0.1,   1.0 -1.0 -0.1,
  24.                          1.0  1.0 -0.1,  -1.0  1.0 -0.1,
  25.                     ]
  26.                 }
  27.                 coordIndex [ 0, 1, 2, 3, ]
  28.                 texCoord TextureCoordinate {
  29.                     point [
  30.                         0.0 0.0,  1.0 0.0,
  31.                         1.0 1.0,  0.0 1.0,
  32.                     ]
  33.                 }
  34.                 texCoordIndex [ 0, 1, 2, 3, ]
  35.                 solid FALSE
  36.             }
  37.         },
  38.     # Grill in front
  39.         Transform {
  40.             translation 0.0 0.0 0.1
  41.             children Shape {
  42.                 appearance Appearance {
  43.                     material Material { }
  44.                     texture ImageTexture {
  45.                         url "grill.png"
  46.                     }
  47.                     textureTransform TextureTransform {
  48.                         rotation 0.785
  49.                         scale 8.0 8.0
  50.                         center 0.5 0.5
  51.                     }
  52.                 }
  53.                 geometry USE Square
  54.             }
  55.         },
  56.     # Animation clock
  57.         DEF Clock TimeSensor {
  58.             cycleInterval 10.0
  59.             loop TRUE
  60.         },
  61.     # Animation path
  62.         DEF FanPath ScalarInterpolator {
  63.             key      [ 0.0, 0.5,  1.0  ]
  64.             keyValue [ 0.0, 3.14, 6.28 ]
  65.         },
  66.     ]
  67. }
  68. ROUTE Clock.fraction_changed TO FanPath.set_fraction
  69. ROUTE FanPath.value_changed  TO FanRotation.set_rotation
  70.